/*
 * @Author: xuhua
 * @Date: 2023-09-13 15:09:26
 * @LastEditors: xuhua
 * @LastEditTime: 2023-09-19 10:47:35
 * @FilePath: /v3-element-admin/src/api/auth/index.ts
 * @Description:
 */
import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { LoginData, LoginResult } from "./types";

export enum Api {
	LOGIN = "/auth/login",
	LOGOUT = "/auth/logout",
	RANDOMIMAGE = "/sys/randomImage/",
}

// 登录
export const loginApi = (data: LoginData): AxiosPromise<LoginResult> => request.post(Api.LOGIN, data);

// 注销(退出登录)
export const logoutApi = () => request.delete(Api.LOGOUT);

// 获取验证码
export const randomImageApi = () => request.get(Api.RANDOMIMAGE + new Date().getTime());
